package com.fa4j.product.stock.repository.impl;

import com.fa4j.common.data.repository.impl.BaseRepositoryImpl;
import com.fa4j.product.stock.model.StockBizType;
import com.fa4j.product.stock.model.StockRecord;
import com.fa4j.product.stock.repository.StockRecordRepository;
import com.fa4j.product.stock.repository.mapper.StockRecordMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 持久化接口实现-商品库存记录
 *
 * @since 2025-11-22 21:06:24
 */
@Repository
public class StockRecordRepositoryImpl extends BaseRepositoryImpl<StockRecordMapper, StockRecord> implements StockRecordRepository {

    @Override
    public void batchCreate(List<StockRecord> recordList) {
        super.saveBatch(recordList, 10);
    }

    @Override
    public List<StockRecord> queryByBizNo(String bizNo, List<StockBizType> bizTypes) {
        return super.lambdaQuery()
                .in(StockRecord::getBizType, bizTypes)
                .eq(StockRecord::getBizNo, bizNo)
                .list();
    }
}


